<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>修改消息</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="/oa/css/message.css" type="text/css" rel="stylesheet" />
<link href="/oa/css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/oa/js/datePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/oa/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
	$(document)
			.ready(
					function(e) {
						$("#beginTime").focus(function() {
							this.blur();
						});
						$("#endTime").focus(function() {
							this.blur();
						});
						$("#saveMessage")
								.click(
										function(e) {
											if ($("#title").val() == "") {
												alert("请输入标题!");
												return;
											}
											if ($("#beginTime").val() == "") {
												alert("请选择开始有效时间!");
												return;
											}
											if ($("#endTime").val() == "") {
												alert("请选择结束有效时间!");
												return;
											}
											if ($("#content").val() == "") {
												alert("请输入消息内容!")
												return;
											}
											var form = document.forms[0];
											form.submit();
										});
					});
</script>
</head>

<body>
	<s:form action="updateMessageToUser" namespace="/messageManage">
		<s:hidden name="messageToUserBean.message.id" />
		<div class="wrap" title="消息填写区">
			<div class="base">
				<table>
					<tr>
						<td><b>消息标题</b>
						</td>
						<td>
						<input name="messageToUserBean.message.title" value="${messageToUserBean.message.title }" />
							<!-- <s:textfield id="title" name="message.title"
								value="%{messageToUserBean.message.title}"></s:textfield> -->
						</td>
					</tr>
					<tr>
						<td>消息类型</td>
						<td><select name="messageType">
								<s:if test="messageToUserBean.message.messgeType.title == '一般' ">
									<option value="General" selected="selected">一般消息</option>
									<option value="Urgent">紧急消息</option>
								</s:if>
								<s:else>
									<option value="General">一般消息</option>
									<option value="Urgent" selected="selected">紧急消息</option>
								</s:else>
						</select></td>
					</tr>
					<tr>
						<td>开始有效时间</td>
						<td><input id="beginTime" name="messageToUserBean.message.beginTime"
							value='<s:date name="messageToUserBean.message.beginTime" format="yyyy-MM-dd hh:mm:ss"/>'
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd 00:00:00'})" />
					</tr>
					<tr>
						<td>结束有效时间</td>
						<td><input id="endTime" name="messageToUserBean.message.endTime"
							value='<s:date name="messageToUserBean.message.endTime" format="yyyy-MM-dd hh:mm:ss"/>'
							onclick="WdatePicker({dateFmt:'yyyy-MM-dd 00:00:00'})" /></td>
					</tr>
					<tr>
						<td><b>发送对象</b>
						</td>
						<td><s:if test='messageToUserBean.toUser == null'>
								<input type="radio" name="radio2" title="所有人" checked="checked"
									disabled="disabled" />所有人
							<input type="radio" name="radio2" title="选择特定对象"
									disabled="disabled" />选择特定对象
						</s:if> <s:elseif test='messageToUserBean.toUser != null'>
								<input type="radio" name="radio2" title="所有人"
									disabled="disabled" />所有人
							<input type="radio" name="radio2" title="选择特定对象"
									checked="checked" disabled="disabled" />选择特定对象
						
						</s:elseif>
						</td>
					</tr>
				</table>
			</div>
			<div class="content">
				<table>
					<tr>
						<td valign="top">消息内容：</td>
						<td>
						<textarea rows="10" cols="100%" name="messageToUserBean.message.content" >${messageToUserBean.message.content }</textarea>
						<!-- <s:textarea id="content" rows="10" cols="100%"
								name="messageToUserBean.message.content"></s:textarea> -->
						</td>
					</tr>
				</table>
			</div>
			<div class="update">
				<input type="button" value="保存消息" class="common_button"
					id="saveMessage" /> <input type="button" value="返回"
					class="common_button" onclick="history.go(-1)" />
			</div>
		</div>
	</s:form>
</body>
</html>
